<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>相对定位</title>
<style>
    .box1 {
        position: relative;
        top: 100px;
        left: 100px;
        width: 200px;
        height: 200px;
        background-color: red;
    }

    .box2 {
        width: 200px;
        height: 200px;
        background-color: gray;
    }
</style>
</head>
<body>
<div class="box1">

</div>
<div class="box2"></div>
</body>
</html>